FROM golang:1.20.2 AS builder

WORKDIR /app

ENV GOPROXY https://goproxy.cn,direct

COPY . .

RUN go mod download

RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /app/zcloud-rbac-app


FROM alpine

WORKDIR /app

COPY --from=builder /app/zcloud-rbac-app /app/zcloud-rbac-app

CMD ["./zcloud-rbac-app"]
